//
//  MoreDetailCell.swift
//  CoolImageFound
//
//  Created by  iBrother 李彦兵 on 2018/6/10.
//  Copyright © 2018  iBrother 李彦兵. All rights reserved.
//

import UIKit

class MoreDetailCell: UICollectionViewFlowLayout {
    
    override func prepare() {
        super.prepare()
        minimumLineSpacing = 0
        minimumInteritemSpacing = 0
        
        sectionInset.top = 0
        sectionInset.left = 0
        sectionInset.right = 0
        
        
    }
    
    override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
//        return nil
        var  array: [UICollectionViewLayoutAttributes]?
        guard let count = self.collectionView?.numberOfItems(inSection: 0) else { return nil }
        for i in 0..<count {
            let indexPath = NSIndexPath(item: i, section: 0)
            let attrs = UICollectionViewLayoutAttributes(forCellWith: indexPath as IndexPath)
            
            attrs.frame = CGRect(x: CGFloat(arc4random_uniform(300)), y: CGFloat(arc4random_uniform(300)), width: CGFloat(arc4random_uniform(300)), height: CGFloat(arc4random_uniform(300)))
            array?.append(attrs)
        }
        
        return array
    }
    
//    override func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {
//        <#code#>
//    }
    
}
